package JavaGuide.reflect;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.springframework.boot.web.embedded.netty.NettyReactiveWebServerFactory;

@Data
@AllArgsConstructor
@NoArgsConstructor
public class Person {
    private String name;
    private Integer age;

    public static void main(String[] args) {
//        获取class对象的四种方法
        Class cla= Person.class;
        System.out.println(cla);
        try {
            Class cla1 = Class.forName("JavaGuide.reflect.Person");
            System.out.println(cla1);
        }catch (Exception e)
        {
            System.out.println(e.toString());
        }
        Person p1= new Person("haha",18);
        Class cla2=p1.getClass();
        System.out.println(cla2);



    }
}
